package com.leinao.media.entity;

import java.util.List;

/**
 * 分页对象
 *
 * @author zhangyu
 * @date 2021/10/9 9:47
 */
public class Pagination<T> {

    /**
     * 当前页
     */
    private int pageNum;

    /**
     * 每页的大小
     */
    private int pageSize;

    /**
     * 总记录数
     */
    private long total;

    /**
     * 数据集
     */
    private List<T> list;

    public Pagination() {

    }

    public Pagination(List<T> list, int pageNum, int pageSize, long total) {
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.total = total;
        this.list = list;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    @Override
    public String toString() {
        return "{" + "pageNum:" + pageNum + ", pageSize:" + pageSize + ", total:" + total + ", list:" + list + '}';
    }

}
